package cn.edu.scau.cmi.chensixiao.multipleton;

import java.util.HashSet;
import java.util.Set;

public class Footballer {
	private String name;
	private static Set<Footballer> footballerSet = new HashSet<Footballer>();
	
	private Footballer(String name) {
		this.setName(name);
	}
	
	public static boolean addInstance(String name){
		boolean sucess = false;
		if(footballerSet.size()<=10) {
			Footballer footballer = new Footballer(name);
			footballerSet.add(footballer);
			sucess = true;
		}
		
		return sucess;
		
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
}
